package cc.ilzy.mall.api.controller;

import cc.ilzy.mall.model.pojo.Product;
import cc.ilzy.mall.model.vo.ProductVO;
import cc.ilzy.mall.utils.ApiResponse;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Api(value = "商品模块", tags = "商品模块")
@RequestMapping("/api/product/v1")
public interface IProductController {
    @GetMapping("/page")
    @ApiImplicitParams({
            @io.swagger.annotations.ApiImplicitParam(name = "page", value = "当前页", required = true, dataType = "int", paramType = "query"),
            @io.swagger.annotations.ApiImplicitParam(name = "size", value = "每页显示多少条", required = true, dataType = "int", paramType = "query")
    })
    ApiResponse<Page<Product>> pageProductList(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int size);

    @ApiOperation(value = "商品信息详情")
    @GetMapping("/detail/{productId}")
    ApiResponse<ProductVO> productDetail(@PathVariable Integer productId);
}
